
//导入request.js请求工具
import request from '@/utils/request'
// 打卡接口
export const submitLeaveService = (params) => {
  return request.post('/user/leave/submit', params)
}
// 获取请假记录
export const getLeaveHistoryApi = (currentPage) => {
  const url = `/user/leave/history?currentPage=${currentPage}`;
  console.log('请求 URL:', url); // 打印请求 URL 进行调试
  return request.get(url);
}

//撤销请假
export const cancelLeaveService = (leaveId) => {
  return request.post('/user/leave/cancel', null, {
    params: {
      leaveId: leaveId
    }
  });
}
//检查员工今日是否请假
export const checkIsLeaveService = () => {
  return request.get('/user/leave/check')
}